package com.cy.pj.sys.controller;

import com.cy.pj.common.vo.JsonResult;
import com.cy.pj.common.vo.PageObject;
import com.cy.pj.sys.entity.SysLog;
import com.cy.pj.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/log")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;

    @GetMapping("/doFindPageObjects")
    public JsonResult doFindPageObjects(String username, Integer pageCurrent){
        PageObject<SysLog> pageObject =
                sysLogService.findPageObjects(username, pageCurrent);

        return new JsonResult(pageObject);
    }

    @RequestMapping("/doDeleteObjects")
    public JsonResult doDeleteObjects(Integer... ids){
        sysLogService.deleteObjects(ids);
        return new JsonResult("delete ok");
    }
}
